;;; init.el --- initialize file of emacs

;; Author: mark Liu <liumiaogemini@gmail.com>

;;; Commentary:
;; To get a faster speed to load Emacs, I cut the most functions form it, only
;; lode them when I need, which use the few functions.

;;; Code:

;; Added by Package.el.  This must come before configurations of
;; installed packages.
(package-initialize)

;;Set load path
(add-to-list 'load-path "~/.emacs.d/lisp")

;;Add init file
(load "init-key-fun-set.el")

;;Rencentf-mode
(recentf-mode 1)
;;(setq recentf-max-menu-items 5)

;;Backup files
(setq make-backup-files nil)

;;Delete selection mode
(delete-selection-mode t)

;; utf-8
(set-language-environment 'Chinese-GB)
(set-keyboard-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)

;; Close the noise when it get wrong
(setq visible-bell nil)

;; Show images in Emacs
(setq auto-image-file-mode t)

;;melpa
(when (>= emacs-major-version 24)
  (require 'package)

  (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
  (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
  
  (package-initialize)
  )
(require 'cl)

;;Init dash
(add-to-list 'load-path "~/.emacs.d/elpa/dash")
(require 'dash)

;;Font set
(set-frame-font "Consolas 13")
(set-fontset-font "fontset-default" 'gb18030 '("DengXian" . "unicode-bmp"))

;;Set line spacing
(setq line-spacing 3)

;;; Electirc enable
(electric-pair-mode 1)
(show-paren-mode t)

;;; Define the editor mode
(defun day-editor-mode()
  (interactive)

  (load "init-editor.el")
  (load "init-cc-mode.el")
  (load "init-ui.el")
  (load "init-custom.el")
  
  ;;Inhibit splash screen
  ;;(setq inhibit-splash-screen t)
  (setq initial-scratch-message nil)

  (require 'solarized-light-theme)
 )

(defun night-editor-mode()
  (interactive)

  (load "init-editor.el")
  (load "init-cc-mode.el")
  (load "init-ui.el")
  (load "init-custom.el")
  (require 'solarized-dark-theme)
  
  ;;Inhibit splash screen
  ;;(setq inhibit-splash-screen t)
  (setq initial-scratch-message nil)
 )

(defun simple-editor-mode()
  (interactive)

  (load "~/.emacs.d/init.el"))

(provide 'init.el)
;;; init.el ends here
